<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <script src="../../xhr_ajax交互/js/jquery-3.6.0.js"></script>
    <style>
        html,
        body,
        #app {
            width: 100%;
            height: 98%;
        }
        
        #invim {
            height: 35px;
            line-height: 35px;
            background-color: rgb(102, 178, 255);
            text-align: center;
            color: #fff;
            font-size: 14px;
            font-weight: bold;
            position: relative;
        }
        
        #invim .span2 {
            font-size: 5px;
            font-weight: normal;
            position: absolute;
            right: 30px;
            bottom: 0;
        }
    </style>
</head>

<body>
    <div id="invim">
        <span class="span1">面试地图</span>
        <span class="span2">面试日程</span>
    </div>
    <div id="app"> </div>

    <script src="https://webapi.amap.com/maps?v=1.4.15&key=4b2b6a877a305659d1d0dd07e290598e"></script>

    <script>
        var map = new AMap.Map('app', {
            resizeEnable: true, //是否监控地图容器尺寸变化
            zoom: 12, //初始化地图层级
            zooms: [1, 12]
        });

        map.on("complete", function() {
            // console.log("地图加载完成！");
            $.ajax({
                type: 'get',
                url: 'http://39.106.207.209:8100/interview/getInterviewAll',
                success(res) {
                    // console.log(res.data[0].latlang);
                    // console.log(o);
                    for (let i = 0; i < res.data.length; i++) {
                        let str = res.data[i].latlang;
                        // console.log(res.data[i]);
                        var marker = new AMap.Marker({
                            icon: "https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png", //icon图标，可以随便换
                            position: str.split(',') //点标记的经纬度
                        });
                        map.add(marker);
                    }
                }
            })
        });
    </script>



</body>

</html>